enum dtype_tac_define {
	TYPE(TAC_DEFINE)=0x5002,
};
enum subtype_TAC_define {
	SUBTYPE(TAC_DEFINE,ACTION)=0x1,
	SUBTYPE(TAC_DEFINE,LOGIN_USER),
	SUBTYPE(TAC_DEFINE,LOGIN_CHALLENGE),
	SUBTYPE(TAC_DEFINE,LOGIN_RETURN),
	SUBTYPE(TAC_DEFINE,CONN_STATE),
	SUBTYPE(TAC_DEFINE,SESSIONKEY_SEND),
	SUBTYPE(TAC_DEFINE,SESSIONKEY_ACCEPT),
	SUBTYPE(TAC_DEFINE,PLATFORM_REPORT),
	SUBTYPE(TAC_DEFINE,PLATFORM_VERIFY),
	SUBTYPE(TAC_DEFINE,NODE_ACL)
};

enum TAC_node_type
{
	TAC_NODE_PM=0x01,
	TAC_NODE_AC,
	TAC_NODE_AR
};

enum TAC_node_state
{
	TAC_STATE_INIT=0x01,
	TAC_STATE_REQUEST,
	TAC_STATE_CHALLENGE,
	TAC_STATE_SERVERVERIFY,
	TAC_STATE_CLIENTVERIFY,
	TAC_STATE_PUBKEYREADY,
	TAC_STATE_SYMMKEYREADY,
	TAC_STATE_PLATFORMVERIFY,
	TAC_STATE_SERVERTRUST,	
	TAC_STATE_CLIENTTRUST,	
	TAC_STATE_TRUST,	
	TAC_STATE_END,	
	TAC_STATE_FAIL	
};

enum enum_TAC_action
{
	TAC_ACTION_INIT=0x01,
	TAC_ACTION_START,
	TAC_ACTION_SUCCESS,
	TAC_ACTION_CHALLENGE=0x10,
	TAC_ACTION_USERIDENTIFY,
	TAC_ACTION_SESSIONKEYSEND,
	TAC_ACTION_SESSIONKEYGET,
	TAC_ACTION_PLATFORMREPORT,
	TAC_ACTION_PLATFORMVERIFY,
	TAC_ACTION_POLICYSEND,
	TAC_ACTION_POLICYUPDATE,
	TAC_ACTION_POLICYDEPOLY,
    TAC_ACTION_ERR_NOUSER=0x100,
	TAC_ACTION_ERR_AUTHFAIL,
	TAC_ACTION_ERR_KEYFAIL,
	TAC_ACTION_ERR_NORIGHT,
	TAC_ACTION_ERR_CHECKFAIL
};

enum TAC_connect_acl
{
	TAC_ACL_INIT=0x01,
	TAC_ACL_ALLOW,
	TAC_ACL_DENY
};

typedef struct TAC_define_action{
    BYTE uuid[32];
    char user[32];
	enum enum_TAC_action action;
	BYTE nonce[32];
}__attribute__((packed)) RECORD(TAC_DEFINE,ACTION);

typedef struct TAC_define_user{
	BYTE uuid[32];
	char user[32];
    char proc_name[32];
	BYTE passwd[32];
	BYTE mac[6];
	BYTE nonce[32];
}__attribute__((packed)) RECORD(TAC_DEFINE,LOGIN_USER);

typedef struct TAC_define_challenge{
	BYTE uuid[32];
	char user[32];
    enum enum_TAC_action retval;
    BYTE nonce[DIGEST_SIZE];
}__attribute__((packed)) RECORD(TAC_DEFINE,LOGIN_CHALLENGE);

typedef struct TAC_define_return{
	UINT32 return_code;
	BYTE nonce[32];
	char * return_info;
}__attribute__((packed)) RECORD(TAC_DEFINE,LOGIN_RETURN);

typedef struct TAC_define_connstate{
	char user[32];
	enum TAC_node_type type;
	enum TAC_node_state state;
    BYTE node_uuid[DIGEST_SIZE];
    char proc_name[32];
    char mac[6];
	BYTE passwd[32];
    BYTE nonce[32];
}__attribute__((packed)) RECORD(TAC_DEFINE,CONN_STATE);
/*
typedef struct connect_conn_info{
	BYTE uuid[32];
	UINT32 type;
	UINT32 state;
	UINT32 peer_state;
	BYTE node_uuid[32];
	char proc_name[32];
	char user_name[32];
	BYTE mac[6];
	char * peer_addr;
}__attribute__((packed)) RECORD(CONNECT_INFO,CONN_INFO);

typedef struct connect_node_acl{
	BYTE node_uuid[32];
	char user_name[32];
	UINT32 acl;
	char * addr;
	char * mac;
}__attribute__((packed)) RECORD(CONNECT_INFO,NODE_ACL);
*/
